<div class="page_head">
<h2><%="Role and Permissions".t%></h2>
</div>
 <%if @project%>
   <%label = "prj_" + @project.id.to_s%>
 <%else%>
   <%label = "com_" + @cur_user.company.id.to_s%>
 <%end%>
<table class=data>
 <tr class=pm_head>
   <th rowspan=2 width=10%><%="Function Category".t%></th>
   <th rowspan=2 width=10%><%="Inherit Parent".t%></th>
   <th colspan=4><%="Permission Items".t%></th>
 </tr>
 <tr class=pm_head>
   <th width=20%><%="View".t%></th>
   <th width=20%><%="View".t%> <%="Private".t%></th>
   <th width=20%><%="Edit".t%></th>
   <th width=20%><%=image_tag"trash.gif"%></th>
 </tr>
 <tr style="background:#ffc">
   <td colspan=2 align=center>[<%="Whole Project".t%>]</td>
   <td align=center>
      <%="All People".t%>
   </td>
   <td id='<%=label%>_parent_private'>
      <%=render :partial=>'per_item',:locals=>{:container_id=>"#{label}_parent_private"}%>
   </td>
   <td id='<%=label%>_parent_edit'%>
      <%=render :partial=>'per_item',:locals=>{:container_id=>"#{label}_parent_edit"}%>
   </td>
   <td id='<%=label%>_parent_del'%>
      <%=render :partial=>'per_item',:locals=>{:container_id=>"#{label}_parent_del"}%>
   </td>
 </tr>
 <%=render :partial=>'per_controll_item',:locals=>{:name=>"Messages".t,:label=>"#{label}_msg",:right=>false}%>
 <%if @project%>
     <%=render :partial=>'per_controll_item',:locals=>{:name=>"Uncategorized".t,:label=>"#{label}_unc_msg_cat",:right=>true}%>
   <%@project.msg_categories.each do |cat|%>
     <%=render :partial=>'per_controll_item',:locals=>{:name=>cat.name,:label=>"#{label}_#{cat.id}_msg_cat",:right=>true}%>
   <%end%>
 <%end%>
 <%=render :partial=>'per_controll_item',:locals=>{:name=>"Todos".t,:label=>"#{label}_todo",:right=>false}%>
 <%=render :partial=>'per_controll_item',:locals=>{:name=>"Milestones".t,:label=>"#{label}_ms",:right=>false}%>
 <%=render :partial=>'per_controll_item',:locals=>{:name=>"Writeboards".t,:label=>"#{label}_wb",:right=>false}%>
 <%if @project%>
     <%=render :partial=>'per_controll_item',:locals=>{:name=>"Uncategorized".t,:label=>"#{label}_unc_wb_cat",:right=>true}%>
  <%@project.wb_categories.each do |cat|%>
    <%=render :partial=>'per_controll_item',:locals=>{:name=>cat.name,:label=>"#{label}_#{cat.id}_wb_cat",:right=>true}%>
  <%end%>
 <%end%>
 <%=render :partial=>'per_controll_item',:locals=>{:name=>"Times".t,:label=>"#{label}_ts",:right=>false}%>
 <%=render :partial=>'per_controll_item',:locals=>{:name=>"Files".t,:label=>"#{label}_fs",:right=>false}%>
 <%if @project%>
     <%=render :partial=>'per_controll_item',:locals=>{:name=>"Uncategorized".t,:label=>"#{label}_unc_fs_cat",:right=>true}%>
  <%@project.file_categories.each do |cat|%>
    <%=render :partial=>'per_controll_item',:locals=>{:name=>cat.name,:label=>"#{label}_#{cat.id}_fs_cat",:right=>true}%>
  <%end%>
 <%end%>
</table>
